@import "./../theme";
@import "./../var";
@import "./widget-vars";

.widget-config-container {
  position: relative;

  .el-header {
    padding: 0 5px;
    display: inline-flex;
    border-bottom: 1px solid $borderColorLight;
    background: $bgColorPrimary;
  }

  .config-tab {
    height: 40px;
    line-height: 40px;
    display: inline-block;
    text-align: center;
    flex: 1;
    font-size: $fontSizeRegular;
    color: $colorTextSecondary;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;

    &:after {
      content: '';
      height: 2px;
      width: 2rem;
      background: transparent;
      display: inline-block;
      position: absolute;
      bottom: 5px;
      left: calc(50% - 1rem);
      border-radius: $radiusSmall;
    }

    &.active {
      color: $colorTextRegular;

      &:after {
        background: $colorPrimary;
      }
    }
  }

  // 组件属性成员列表载体
  .config-content {
    position: relative;
    height: calc(100vh - 95px);
    overflow: auto;
    background: $bgColorPrimary;
    padding: 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */

    // 隐藏滚动条
    &::-webkit-scrollbar {
      display: none; /* Chrome Safari */
    }

    .applicable-tip {
      padding: 0.3rem 0.5rem 0.4rem;
      line-height: 1.2;

      .el-alert__title{
        font-size: $fontSizeSmall;
      }
    }

    .widget-form-item-group {
      padding: $widget-form-item-group-padding;

      & + .widget-form-item-group {
        border-top: 1px solid $borderColorLight;
      }
    }

    .el-input:not(.el-input--prefix) {
      .el-input__inner, .el-textarea__inner {
        padding-left: 8px;
      }
    }

    .el-select {
      & + .el-textarea {
        margin-top: 5px;
      }
    }

    .el-textarea {
      & + .el-textarea {
        margin-top: 5px;
      }
    }

    .el-input-number {
      .el-input__inner, .el-textarea__inner {
        padding-right: 8px;
      }
    }

    // 空数据样式
    .empty {
      text-align: center;
      width: 100%;
      height: 90vh;
      color: $colorTextSecondary;
      font-size: 1rem;
    }

    // 小号元素样式
    small {
      color: $colorTextSecondary;
      font-size: $fontSizeMini;
      margin: 0 0.2rem;
    }

    .config-number-input {
      text-align: center;
    }

    .config-number-unit {
      color: $colorTextSecondary;
      font-size: $fontSizeMini;
      margin-left: 0.3rem;
    }

    // 组件属性成员 - 一级分组 - 折叠面板
    .el-collapse-item {
      // 组件属性成员 - 一级分组 - 折叠面板 - header
      .el-collapse-item__header {
        padding-left: $widget-config-layout-padding-width;
        height: 2.25rem;
        line-height: 2.25rem;
        font-size: $fontSizeRegular;
        border-bottom: none;
        background: $bgColorSecondary;

        &:hover, &.is-active {
          background: $bgColorSecondary;
          border-bottom: none;
        }
      }

      // 组件属性成员 - 一级分组 - 折叠面板 - 折叠区域
      .el-collapse-item__wrap {
        border-bottom: none;
        border-top: none;
        background: $bgColorPrimary;

        // 组件属性成员 - 一级分组 - 折叠面板 - 折叠区域 - content
        .el-collapse-item__content {
          padding-left: $widget-config-layout-padding-width;
          border-bottom: $widget-form-item-group-border;
        }
      }
    }

    // 处理末位元素
    .el-collapse-item:last-child {
      .el-collapse-item__wrap {
        .el-collapse-item__content {
          border-bottom-color: transparent;
        }
      }
    }

    // 表单成员
    .el-form-item {
      margin-bottom: $widget-config-form-item-space;

      // 表单成员 - 标题
      .el-form-item__label {
        padding: 0.25rem 0.3rem 0 0;
        font-size: 13px;
        color: $colorTextPrimary;
        line-height: 22px;
      }

      // 表单成员 - 主体部分
      .el-form-item__content {
        // checkbox 成员 - 标题
        .el-checkbox__label, .el-radio__label {
          font-size: $fontSizeSmall;
        }

        // 表单成员 - 主体部分 - 子成员主体部分 : 用于并排展示多个录入组件
        .el-form-item__sub-content {
          &.el-select, &.el-button {
            width: 100%;
          }
        }
      }

      // element-ui 组件特殊处理
      .el-input-number {
        width: 150px;
      }
    }

    .el-divider--horizontal {
      margin: 9px 0;
    }

    // 选项设置
    .option-config-section {

      ul {
        margin: 0;
        padding: 0;
      }

      // 选项 - 行属性
      .el-row {
        margin-bottom: $common-size-default;
      }

      // 带有按钮的 input 组件
      .el-input-group {
        height: 30px;
        line-height: 30px;


        .drag-item {
          color: $colorInfo;
          margin: 0;
          cursor: move;
        }

        // 输入框功能键
        .el-input-group__prepend, .el-input-group__append {
          height: 30px;
          line-height: 27px;
          text-align: center;
          padding: 0;
          margin: 0;
          background: $widget-config-option-config-section-bg;

          // 行内操作按钮
          .option-operator-btn-inline {
            padding: 0;
            margin: 0;
            text-align: center;
            width: 26px;
            height: 70%;
            border-radius: 0 !important;
            border-right: 1px solid $bodyBgColor !important;
          }

          .base-icon {
            color: $widget-config-option-config-section-text-color;
            text-align: center;
            margin-right: 0;

            &.error-color {
              color: $widget-config-error-color;
            }
          }
        }

        // 输入框主体
        .el-input__inner {
          height: 30px;
          line-height: 30px;
        }

        a:hover {
          cursor: pointer;
        }

      }

      // 单选/多选组件
      .el-radio-group, .el-checkbox-group {
        width: 100%;

        li {
          padding: 0 $commonPaddingSmall;
          margin-bottom: $common-size-large;

          .el-radio, .el-checkbox {
            width: 100%;

            .el-radio__input, .el-checkbox__input {
              text-align: center;
              width: 28px;
              height: 28px;
              line-height: 30px;
              float: left;
            }

            .el-radio__label, .el-checkbox__label {
              width: calc(100% - 28px);
              display: inline-block;
              height: 28px;
              line-height: 28px;
              float: left;
              padding: 0;

              .inline-option-item {
                width: 100%;

                .sub-item {
                  display: flex;
                  float: left;
                  height: 28px;
                  line-height: 28px;
                  outline: 1px solid #C9CDD4;

                  &.input-box {
                    width: calc(100% - 28px - 28px);
                  }

                  &.sub-input-box {
                    padding: 0 1px;
                    width: calc((100% - 28px - 28px) / 2);
                  }

                  .operate-btn {
                    width: 28px;
                    height: 28px;
                    line-height: 28px;
                    text-align: center;
                    margin: 0;

                    &.error-color {
                      color: $widget-config-error-color;
                    }
                  }

                  // 输入框样式处理
                  .el-input__inner {
                    border-radius: 0;
                    border: none;
                  }
                }
              }
            }
          }
        }
      }

      .option-config-tools {
        text-align: right;

        .option-error{
          float:left;
          color: #F53F3F;
          font-size: 12px;
          padding-top: 4px;
        }
      }
    }
  }
}
